package com.hxd.otc.module.convenience.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hxd.otc.R;
import com.hxd.otc.module.convenience.bean.NorGoodsBean;
import com.hxd.otc.utils.UIUtils;

/**
 * 包  名 :  com.hxd.otc.module.convenience.adapter
 * 类  名 :  RefuelingServiceAdapter
 * 作  者 :  zjl
 * 时  间 :  2018/12/13 11:21
 * 描  述 :  ${TODO}
 */
public class OilRMBAdapter extends BaseQuickAdapter<NorGoodsBean, BaseViewHolder> {

    private boolean mEnable;

    public void setEnable(boolean enable) {
        if (mEnable != enable) {
            mEnable = enable;
            notifyDataSetChanged();
        }
    }

    public OilRMBAdapter() {
        super(R.layout.adapter_recharge_rmb, null);
    }

    @Override
    protected void convert(BaseViewHolder helper, NorGoodsBean item) {

        helper.setText(R.id.tv_rmb, item.getSellPrice() + item.getPriceUnit());
        helper.setText(R.id.tv_coin, UIUtils.getContext().getString(R.string.selling_price, item.getVolume() + "", item.getSymbol() + ""));
        helper.getView(R.id.ll_item).setEnabled(mEnable);
        helper.getView(R.id.tv_rmb).setEnabled(mEnable);
        helper.getView(R.id.tv_coin).setEnabled(mEnable);
//        switch (item.getBgType()) {
//            case 0:
//                helper.getView(R.id.ll_item).setBackground(UIUtils.getContext().getResources().getDrawable(R.drawable.bg_recharge_rmb_gray));
//                helper.setTextColor(R.id.tv_rmb, UIUtils.getContext().getResources().getColor(R.color.color_text1));
//                helper.setTextColor(R.id.tv_coin, UIUtils.getContext().getResources().getColor(R.color.color_text1));
//                break;
//            case 1:
//                helper.setTextColor(R.id.tv_rmb, UIUtils.getContext().getResources().getColor(R.color.color_text1));
//                helper.setTextColor(R.id.tv_coin, UIUtils.getContext().getResources().getColor(R.color.color_text1));
//                helper.getView(R.id.ll_item).setBackground(UIUtils.getContext().getResources().getDrawable(R.drawable.bg_recharge_rmb_blue));
//                break;
//            case 2:
//                helper.setTextColor(R.id.tv_rmb, UIUtils.getContext().getResources().getColor(R.color.colorWhite));
//                helper.setTextColor(R.id.tv_coin, UIUtils.getContext().getResources().getColor(R.color.colorWhite));
//                helper.getView(R.id.ll_item).setBackground(UIUtils.getContext().getResources().getDrawable(R.drawable.bg_recharge_rmb_blue_click));
//                break;
//        }

    }
}
